Fix: Accordion collapsed state background color not applying correctly#3675
Conversation
When using different background colors for Normal and Collapsed states on the accordion's inner column, the Collapsed state color was not being applied when the accordion was closed. **Root Cause:** 1. CSS selector in block-css/index.js was targeting '.stk-block-accordion.stk--is-open' which applied collapsed styles when accordion was OPEN (inverted logic) 2. Frontend class toggle was toggling based on class existence instead of the actual 'open' attribute state **Fixes:** 1. Changed collapsed CSS selector to ':not(.stk--is-open)' to correctly apply styles when accordion is closed 2. Fixed frontend-accordion.js to add/remove 'stk--is-open' class based on el.open property instead of toggling Fixes gambitph#3670
📝 WalkthroughWalkthroughThe accordion component's state determination has been refactored. The frontend logic now directly checks the element's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)src/components/block-css/index.js (2)
🔇 Additional comments (1)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When using different background colors for Normal and Collapsed states on the accordion's inner column, the Collapsed state color was not being applied when the accordion was closed.
Root Cause:
Fixes:
Screenshots:


Fixes #3670
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.